#ifndef HTML_EXPORTER_H
#define HTML_EXPORTER_H

#include "iexporter.h"

#include <bignumbers.h>

class QStandardItemModel;

namespace swp
{

class HtmlExporter : public IExporter
{
public:
    HtmlExporter();
    ~HtmlExporter();

    void exportReport(const QUrl& url,
        const QSharedPointer<core::IDocument>& report) const;
    IExporter* copy();

private:
    QString getSuccess(const QStandardItemModel* model, bool& success) const;
    void getOverview(const QStandardItemModel* model, int& runs,
        QString& totalCost, QString& avgCost,
        QString& totalDuration, QString& avgDuration,
        QHash<QString, QList<bignumbers::BigInt> >& activityDetail,
        QHash<QString, QList<bignumbers::BigFloat> >& activityDetailAvgs) const;
    void generateActivityDetailHtml(
        QHash<QString, QList<bignumbers::BigInt> >& activityDetail,
        QHash<QString, QList<bignumbers::BigFloat> >& activityDetailAvgs,
        QString& content) const;
};

} // namespace swp

#endif
